let foo = 'get-element-by-id'
let arr = foo.split('-')

let newFoo = ''
for (let i = 0; i < arr.length; i++) {
  let str = arr[i]
  //首字母转大写+后续
  newFoo += str[0].toUpperCase() + str.slice(1)
}

console.log(newFoo)
